package com.mega.fe.fuck;

import com.mega.fe.mixins.AccessInventory;
import com.mega.fe.registry.ItemInit;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

import java.util.Iterator;
import java.util.List;

public class FuckPlayerInventory extends Inventory {
    public FuckPlayerInventory(Player p_35983_) {
        super(p_35983_);
    }

    @Override
    public void dropAll() {
        Iterator var1 = ((AccessInventory)this).compartments().iterator();

        while(var1.hasNext()) {
            List<ItemStack> list = (List)var1.next();

            for(int i = 0; i < list.size(); ++i) {
                ItemStack itemstack = (ItemStack)list.get(i);
                if (itemstack.is(ItemInit.SWORD.get())  || itemstack.is(ItemInit.DEATH.get()))
                    continue;
                if (!itemstack.isEmpty()) {
                    this.player.drop(itemstack, true, false);
                    list.set(i, ItemStack.EMPTY);
                }
            }
        }
    }
}
